<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8" %>
<%@include file="/commons/taglibs.jsp" %>
<!DOCTYPE html>
<html>
<fmt:bundle basename="res">
<head>
    <meta charset="utf-8">
    <title><fmt:message key='zhht' /></title>
    <jsp:include page="/WEB-INF/commons/commons-header.jsp" flush="true"/>
    <style>
        html {
            background: #fff;
        }
    </style>
</head>

<body>
<div class="layui-container">
    <br class="layui-form" lay-filter="layuiadmin-app-form-list" id="layuiadmin-app-form-list" style="padding: 20px 30px 0 0;">
    <form:form commandName="merchant" method="${_method }" class="layui-form" id="serviceForm">
        <input type="hidden" name="_method" value="${_method }"/>

        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
            <legend><fmt:message key='dpxx' /></legend>
        </fieldset>


        <div class="layui-form-item">
            <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='jysplm' /></label>
            <div class="layui-form-mid layui-word-aux">
                <c:forEach items="${channels}" var="item">
                    <c:if test="${fn:contains(channelNames, item.name)}">${item.name}</c:if>
                </c:forEach>
            </div>

        </div>

        <div class="layui-row layui-col-space30">
            <div class="layui-col-md6">

                <div class="layui-form-item">
                    <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='dpmc' /></label>
                    <div class="layui-form-mid layui-word-aux">
                        <form:input path="shopName" lay-verify="required" class="layui-input"/>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='lxrmc' /></label>
                    <div class="layui-input-inline">
                        <form:input path="realName" lay-verify="required" class="layui-input"/>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='yx' /></label>
                    <div class="layui-input-inline">
                        <form:input path="email" lay-verify="required" class="layui-input"/>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='dpbjt' /></label>
                    <div class="layui-input-block">
                        <form:hidden path="shopBanner" id="shopBanner" class="layui-input"/>
                        <a type="button" id="choose-shopBanner" value="<fmt:message key='shaungchuan' />" class="layui-btn layui-btn-sm layui-btn-normal"><fmt:message key='sctp' /></a>
                        <div id="feijinImage-shopBanner">
                            <c:if test="${not empty merchant.shopBanner}">
                                <img src="${store_domain}/uploads/${merchant.shopBanner}" style="width:120px;height:120px;margin-top:10px;">
                            </c:if>
                            <c:if test="${empty merchant.shopBanner}">
                                <img src="${web_domain}/resources/images/default.jpeg" style="width:120px;height:120px;margin-top:10px;">
                            </c:if>
                        </div>
                    </div>
                </div>


            </div>
            <div class="layui-col-md6">

                <div class="layui-form-item">
                    <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='lxdh' /></label>
                    <div class="layui-input-inline">
                        <form:input path="mobile" lay-verify="required" class="layui-input"/>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='wx' /></label>
                    <div class="layui-input-inline">
                        <form:input path="wechat" lay-verify="required" class="layui-input"/>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label"><b style="color:red">*</b> QQ</label>
                    <div class="layui-input-inline">
                        <form:input path="qq" lay-verify="required" class="layui-input"/>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='dptx' /></label>
                    <div class="layui-input-block">
                        <form:hidden path="avatar" id="avatar" class="layui-input"/>
                        <a type="button" id="choose-avatar" value="上传" class="layui-btn layui-btn-sm layui-btn-normal"><fmt:message key='sctp' /></a>
                        <div id="feijinImage-avatar">
                            <c:if test="${not empty merchant.avatar}">
                                <img src="${store_domain}/avatar/${merchant.avatar}" style="width:120px;height:120px;margin-top:10px;">
                            </c:if>
                            <c:if test="${empty merchant.avatar}">
                                <img src="${web_domain}/resources/images/default.jpeg" style="width:120px;height:120px;margin-top:10px;">
                            </c:if>
                        </div>
                    </div>
                </div>

            </div>
        </div>



        <div class="layui-form-item">
            <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='sjztlx' /></label>
            <div class="layui-input-inline" style="width:70%;">
                <input type="radio" name="mainType" lay-filter="mainType" lay-verify="required" value="1" title="企业" <c:if test="${merchant.mainType eq 1}">checked="checked"</c:if>/>
                <input type="radio" name="mainType" lay-filter="mainType" lay-verify="required" value="2" title="个体户" <c:if test="${merchant.mainType eq 2}">checked="checked"</c:if>/>
                <input type="radio" name="mainType" lay-filter="mainType" lay-verify="required" value="3" title="个人" <c:if test="${merchant.mainType eq 3}">checked="checked"</c:if>/>
            </div>
        </div>

        <div id="merchantEnterpriseInfo" style="display:none;">


            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                <legend><fmt:message key='qyxx' /></legend>
            </fieldset>
            <form:hidden path="merchantEnterpriseInfo.id" class="layui-input"/>

            <div class="layui-row layui-col-space30">
                <div class="layui-col-md6">


                    <div class="layui-form-item">
                        <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='gsmc' /></label>
                        <div class="layui-input-inline">
                            <form:input path="merchantEnterpriseInfo.company" class="layui-input"/>
                        </div>
                    </div>


                    <div class="layui-form-item">
                        <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='frxm' /></label>
                        <div class="layui-input-inline">
                            <form:input path="merchantEnterpriseInfo.legalPersonRealname" class="layui-input"/>
                        </div>
                    </div>


                    <div class="layui-form-item">
                        <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='quyu' /></label>
                        <div class="layui-input-inline" style="width: 100px;">
                            <select id="merchantEnterpriseInfo-province" name="merchantEnterpriseInfo.province" lay-filter="merchantEnterpriseInfo-province">
                                <option value="" data_id=""><fmt:message key='qxzs' /></option>
                            </select>

                        </div>

                        <div class="layui-input-inline" style="width: 100px;">
                            <select id="merchantEnterpriseInfo-city" name="merchantEnterpriseInfo.city" lay-filter="merchantEnterpriseInfo-city">
                                <option value="" data_id=""><fmt:message key='qxzx' /></option>
                            </select>

                        </div>

                        <div class="layui-input-inline" style="width: 100px;">
                            <select id="merchantEnterpriseInfo-area" name="merchantEnterpriseInfo.area">
                                <option value="" data_id=""><fmt:message key='qxzq' /></option>
                            </select>

                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='frsfzzm' /></label>
                        <div class="layui-input-block">
                            <form:hidden path="merchantEnterpriseInfo.legalPersonIdCardPhoto" id="merchantEnterpriseInfo-legalPersonIdCardPhoto" class="layui-input"/>
                            <a type="button" id="choose-merchantEnterpriseInfo-legalPersonIdCardPhoto" value="<fmt:message key='sc' />" class="layui-btn layui-btn-sm layui-btn-normal"><fmt:message key='sctp' /></a>
                            <div id="feijinImage-merchantEnterpriseInfo-legalPersonIdCardPhoto">
                                <c:if test="${not empty merchant.merchantEnterpriseInfo.legalPersonIdCardPhoto}">
                                    <img src="${store_domain}/uploads/${merchant.merchantEnterpriseInfo.legalPersonIdCardPhoto}" style="width:120px;height:120px;margin-top:10px;">
                                </c:if>
                                <c:if test="${empty merchant.merchantEnterpriseInfo.legalPersonIdCardPhoto}">
                                    <img src="${web_domain}/resources/images/default.jpeg" style="width:120px;height:120px;margin-top:10px;">
                                </c:if>
                            </div>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='gsyyzz' /></label>
                        <div class="layui-input-block">
                            <form:hidden path="merchantEnterpriseInfo.businessLicensePhoto" id="merchantEnterpriseInfo-businessLicensePhoto" class="layui-input"/>
                            <a type="button" id="choose-merchantEnterpriseInfo-businessLicensePhoto" value="<fmt:message key='shaungchuan' />" class="layui-btn layui-btn-sm layui-btn-normal"><fmt:message key='sctp' /></a>
                            <div id="feijinImage-merchantEnterpriseInfo-businessLicensePhoto">
                                <c:if test="${not empty merchant.merchantEnterpriseInfo.businessLicensePhoto}">
                                    <img src="${store_domain}/uploads/${merchant.merchantEnterpriseInfo.businessLicensePhoto}" style="width:120px;height:120px;margin-top:10px;">
                                </c:if>
                                <c:if test="${empty merchant.merchantEnterpriseInfo.businessLicensePhoto}">
                                    <img src="${web_domain}/resources/images/default.jpeg" style="width:120px;height:120px;margin-top:10px;">
                                </c:if>
                            </div>
                        </div>
                    </div>

                </div>
                <div class="layui-col-md6">

                    <div class="layui-form-item">
                        <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='yyzzhm' /></label>
                        <div class="layui-input-inline">
                            <form:input path="merchantEnterpriseInfo.businessLicenseNo" class="layui-input"/>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='frsfz' /></label>
                        <div class="layui-input-inline">
                            <form:input path="merchantEnterpriseInfo.legalPersonIdCardNo" class="layui-input"/>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='dz' /></label>
                        <div class="layui-input-inline">
                            <form:input path="merchantEnterpriseInfo.address" class="layui-input"/>
                        </div>
                    </div>


                    <div class="layui-form-item">
                        <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='frsfzfm' /></label>
                        <div class="layui-input-block">
                            <form:hidden path="merchantEnterpriseInfo.legalPersonIdCardPhotoBack" id="merchantEnterpriseInfo-legalPersonIdCardPhotoBack" class="layui-input"/>
                            <a type="button" id="choose-merchantEnterpriseInfo-legalPersonIdCardPhotoBack" value="<fmt:message key='shaungchuan' />" class="layui-btn layui-btn-sm layui-btn-normal"><fmt:message key='sctp' /></a>
                            <div id="feijinImage-merchantEnterpriseInfo-legalPersonIdCardPhotoBack">
                                <c:if test="${not empty merchant.merchantEnterpriseInfo.legalPersonIdCardPhotoBack}">
                                    <img src="${store_domain}/uploads/${merchant.merchantEnterpriseInfo.legalPersonIdCardPhotoBack}" style="width:120px;height:120px;margin-top:10px;">
                                </c:if>
                                <c:if test="${empty merchant.merchantEnterpriseInfo.legalPersonIdCardPhotoBack}">
                                    <img src="${web_domain}/resources/images/default.jpeg" style="width:120px;height:120px;margin-top:10px;">
                                </c:if>
                            </div>
                        </div>
                    </div>

                </div>
            </div>
        </div>

        <div id="merchantIndividualInfo" style="display:none;">

            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                <legend><fmt:message key='gthxx' /></legend>
            </fieldset>

            <div class="layui-form-item">
                <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='xm' /></label>
                <div class="layui-input-inline">
                    <form:input path="merchantIndividualInfo.legalPersonRealname" class="layui-input"/>
                </div>
            </div>

            <form:hidden path="merchantIndividualInfo.id" class="layui-input"/>

            <div class="layui-row layui-col-space30">
                <div class="layui-col-md6">

                    <div class="layui-form-item">
                        <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='ssqy' /></label>
                        <div class="layui-input-inline" style="width: 100px;">
                            <select id="merchantIndividualInfo-province" name="merchantIndividualInfo.province" lay-filter="merchantIndividualInfo-province">
                                <option value="" data_id=""><fmt:message key='qxzs' /></option>
                            </select>

                        </div>

                        <div class="layui-input-inline" style="width: 100px;">
                            <select id="merchantIndividualInfo-city" name="merchantIndividualInfo.city" lay-filter="merchantIndividualInfo-city">
                                <option value="" data_id=""><fmt:message key='qxzx' /></option>
                            </select>

                        </div>

                        <div class="layui-input-inline" style="width: 100px;">
                            <select id="merchantIndividualInfo-area" name="merchantIndividualInfo.area">
                                <option value="" data_id=""><fmt:message key='qxzq' /></option>
                            </select>

                        </div>
                    </div>


                    <div class="layui-form-item">
                        <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='yyzzhm' /></label>
                        <div class="layui-input-inline">
                            <form:input path="merchantIndividualInfo.businessLicenseNo" class="layui-input"/>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='sfzfm' /></label>
                        <div class="layui-input-block">
                            <form:hidden path="merchantIndividualInfo.idCardPhoto" id="merchantIndividualInfo-idCardPhoto" class="layui-input"/>
                            <a type="button" id="choose-merchantIndividualInfo-idCardPhoto" value="<fmt:message key='shaungchuan' />" class="layui-btn layui-btn-sm layui-btn-normal"><fmt:message key='sctp' /></a>
                            <div id="feijinImage-merchantIndividualInfo-idCardPhoto">
                                <c:if test="${not empty merchant.merchantIndividualInfo.idCardPhoto}">
                                    <img src="${store_domain}/uploads/${merchant.merchantIndividualInfo.idCardPhoto}" style="width:120px;height:120px;margin-top:10px;">
                                </c:if>
                                <c:if test="${empty merchant.merchantIndividualInfo.idCardPhoto}">
                                    <img src="${web_domain}/resources/images/default.jpeg" style="width:120px;height:120px;margin-top:10px;">
                                </c:if>
                            </div>
                        </div>
                    </div>


                    <div class="layui-form-item">
                        <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='yyzz' /></label>
                        <div class="layui-input-block">
                            <form:hidden path="merchantIndividualInfo.businessLicensePhoto" id="merchantIndividualInfo-businessLicensePhoto" class="layui-input"/>
                            <a type="button" id="choose-merchantIndividualInfo-businessLicensePhoto" value="上传" class="layui-btn layui-btn-sm layui-btn-normal">上传图片</a>
                            <div id="feijinImage-merchantIndividualInfo-businessLicensePhoto">
                                <c:if test="${not empty merchant.merchantIndividualInfo.businessLicensePhoto}">
                                    <img src="${store_domain}/uploads/${merchant.merchantIndividualInfo.businessLicensePhoto}" style="width:120px;height:120px;margin-top:10px;">
                                </c:if>
                                <c:if test="${empty merchant.merchantIndividualInfo.businessLicensePhoto}">
                                    <img src="${web_domain}/resources/images/default.jpeg" style="width:120px;height:120px;margin-top:10px;">
                                </c:if>
                            </div>
                        </div>
                    </div>

                </div>
                <div class="layui-col-md6">

                    <div class="layui-form-item">
                        <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='sfz' /></label>
                        <div class="layui-input-inline">
                            <form:input path="merchantIndividualInfo.idCardNo" class="layui-input"/>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='dz' /></label>
                        <div class="layui-input-inline">
                            <form:input path="merchantIndividualInfo.address" class="layui-input"/>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='sfzfm' /></label>
                        <div class="layui-input-block">
                            <form:hidden path="merchantIndividualInfo.idCardPhotoBack" id="merchantIndividualInfo-idCardPhotoBack" class="layui-input"/>
                            <a type="button" id="choose-merchantIndividualInfo-idCardPhotoBack" value="上传" class="layui-btn layui-btn-sm layui-btn-normal"><fmt:message key='sctp' /></a>
                            <div id="feijinImage-merchantIndividualInfo-idCardPhotoBack">
                                <c:if test="${not empty merchant.merchantIndividualInfo.idCardPhotoBack}">
                                    <img src="${store_domain}/uploads/${merchant.merchantIndividualInfo.idCardPhotoBack}" style="width:120px;height:120px;margin-top:10px;">
                                </c:if>
                                <c:if test="${empty merchant.merchantIndividualInfo.idCardPhotoBack}">
                                    <img src="${web_domain}/resources/images/default.jpeg" style="width:120px;height:120px;margin-top:10px;">
                                </c:if>
                            </div>
                        </div>
                    </div>

                </div>
            </div>
        </div>

        <div id="merchantPersonalInfo" style="display:none;">


            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                <legend>个人信息</legend>
            </fieldset>

            <form:hidden path="merchantPersonalInfo.id" class="layui-input"/>

            <div class="layui-row layui-col-space30">
                <div class="layui-col-md6">


                    <div class="layui-form-item">
                        <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='xm' /></label>
                        <div class="layui-input-inline">
                            <form:input path="merchantPersonalInfo.legalPersonRealname" class="layui-input"/>
                        </div>
                    </div>


                    <div class="layui-form-item">
                        <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='ssqy' /></label>
                        <div class="layui-input-inline" style="width: 100px;">
                            <select id="merchantPersonalInfo-province" name="merchantPersonalInfo.province" lay-filter="merchantPersonalInfo-province">
                                <option value="" data_id=""><fmt:message key='qxzs' /></option>
                            </select>

                        </div>

                        <div class="layui-input-inline" style="width: 100px;">
                            <select id="merchantPersonalInfo-city" name="merchantPersonalInfo.city" lay-filter="merchantPersonalInfo-city">
                                <option value="" data_id=""><fmt:message key='qxzx' /></option>
                            </select>

                        </div>

                        <div class="layui-input-inline" style="width: 100px;">
                            <select id="merchantPersonalInfo-area" name="merchantPersonalInfo.area">
                                <option value="" data_id=""><fmt:message key='qxzq' /></option>
                            </select>

                        </div>
                    </div>


                    <div class="layui-form-item">
                        <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='sfzfm' /></label>
                        <div class="layui-input-block">
                            <form:hidden path="merchantPersonalInfo.legalPersonIdCardPhoto" id="merchantPersonalInfo-legalPersonIdCardPhoto" class="layui-input"/>
                            <a type="button" id="choose-merchantPersonalInfo-legalPersonIdCardPhoto" value="<fmt:message key='shaungchuan' />" class="layui-btn layui-btn-sm layui-btn-normal"><fmt:message key='sctp' /></a>
                            <div id="feijinImage-merchantPersonalInfo-legalPersonIdCardPhoto">
                                <c:if test="${not empty merchant.merchantPersonalInfo.legalPersonIdCardPhoto}">
                                    <img src="${store_domain}/uploads/${merchant.merchantPersonalInfo.legalPersonIdCardPhoto}" style="width:120px;height:120px;margin-top:10px;">
                                </c:if>
                                <c:if test="${empty merchant.merchantPersonalInfo.legalPersonIdCardPhoto}">
                                    <img src="${web_domain}/resources/images/default.jpeg" style="width:120px;height:120px;margin-top:10px;">
                                </c:if>
                            </div>
                        </div>
                    </div>

                </div>
                <div class="layui-col-md6">

                    <div class="layui-form-item">
                        <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='sfzhm' /></label>
                        <div class="layui-input-inline">
                            <form:input path="merchantPersonalInfo.idCardNo" class="layui-input"/>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label"><fmt:message key='dz' /></label>
                        <div class="layui-input-inline">
                            <form:input path="merchantPersonalInfo.address" class="layui-input"/>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='sfzfm' /></label>
                        <div class="layui-input-block">
                            <form:hidden path="merchantPersonalInfo.legalPersonIdCardPhotoBack" id="merchantPersonalInfo-legalPersonIdCardPhotoBack" class="layui-input"/>
                            <a type="button" id="choose-merchantPersonalInfo-legalPersonIdCardPhotoBack" value="<fmt:message key='shaungchuan' />" class="layui-btn layui-btn-sm layui-btn-normal">上传图片</a>
                            <div id="feijinImage-merchantPersonalInfo-legalPersonIdCardPhotoBack">
                                <c:if test="${not empty merchant.merchantPersonalInfo.legalPersonIdCardPhotoBack}">
                                    <img src="${store_domain}/uploads/${merchant.merchantPersonalInfo.legalPersonIdCardPhotoBack}" style="width:120px;height:120px;margin-top:10px;">
                                </c:if>
                                <c:if test="${empty merchant.merchantPersonalInfo.legalPersonIdCardPhotoBack}">
                                    <img src="${web_domain}/resources/images/default.jpeg" style="width:120px;height:120px;margin-top:10px;">
                                </c:if>
                            </div>
                        </div>
                    </div>


                </div>
            </div>
        </div>

        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
            <legend><fmt:message key='yhkxx' /></legend>
        </fieldset>

        <div class="layui-row layui-col-space30">

            <div class="layui-col-md6">

                <div class="layui-form-item">
                    <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='khr' /></label>
                    <div class="layui-input-inline">
                        <form:input path="bankAccountHolder" lay-verify="required" class="layui-input"/>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='yhkh' /></label>
                    <div class="layui-input-inline">
                        <form:input path="bankCardNo" lay-verify="required|bankcard" class="layui-input"/>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='khh' /></label>
                    <div class="layui-input-inline">
                        <form:input path="bankName" lay-verify="required" class="layui-input"/>
                    </div>
                </div>


            </div>

            <div class="layui-col-md6">
                <div class="layui-form-item">
                    <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='ylsjh' /></label>
                    <div class="layui-input-inline">
                        <form:input path="bankMobile" lay-verify="required|number" class="layui-input"/>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='ssss' /></label>
                    <div class="layui-input-inline" style="width: 100px;">
                        <select id="bankProvince" name="bankProvince" lay-filter="bankProvince">
                            <option value="" data_id=""><fmt:message key='qxzs' /></option>
                        </select>
                    </div>
                    <div class="layui-input-inline" style="width: 100px;">
                        <select id="bankCity" name="bankCity" lay-filter="bankCity">
                            <option value="" data_id=""><fmt:message key='qxzx' /></option>
                        </select>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='khzh' /></label>
                    <div class="layui-input-inline">
                        <form:input path="bankSubBranchName" lay-verify="required" class="layui-input"/>
                    </div>
                </div>
            </div>
        </div>


        <div class="layui-input-block">
            <input type="button" value="<fmt:message key='bc' />" class="layui-btn" id="submit" lay-filter="submit" lay-submit>
        </div>

    </form:form>
    </br>
    </br>
    </br>
</div>
</div>

<div style="display:none;">

    <form action="${web_domain}/upload/image" method="post" id="upload-merchantEnterpriseInfo-legalPersonIdCardPhoto" enctype="multipart/form-data">
        <input id="merchantEnterpriseInfo-legalPersonIdCardPhoto-file" name="file" type="file"/>
    </form>

    <form action="${web_domain}/upload/image" method="post" id="upload-merchantEnterpriseInfo-businessLicensePhoto" enctype="multipart/form-data">
        <input id="merchantEnterpriseInfo-businessLicensePhoto-file" name="file" type="file"/>
    </form>

    <form action="${web_domain}/upload/image" method="post" id="upload-merchantEnterpriseInfo-legalPersonIdCardPhotoBack" enctype="multipart/form-data">
        <input id="merchantEnterpriseInfo-legalPersonIdCardPhotoBack-file" name="file" type="file"/>
    </form>


    <form action="${web_domain}/upload/image" method="post" id="upload-merchantIndividualInfo-idCardPhoto" enctype="multipart/form-data">
        <input id="merchantIndividualInfo-idCardPhoto-file" name="file" type="file"/>
    </form>

    <form action="${web_domain}/upload/image" method="post" id="upload-merchantIndividualInfo-businessLicensePhoto" enctype="multipart/form-data">
        <input id="merchantIndividualInfo-businessLicensePhoto-file" name="file" type="file"/>
    </form>

    <form action="${web_domain}/upload/image" method="post" id="upload-merchantIndividualInfo-idCardPhotoBack" enctype="multipart/form-data">
        <input id="merchantIndividualInfo-idCardPhotoBack-file" name="file" type="file"/>
    </form>

    <form action="${web_domain}/upload/image" method="post" id="upload-merchantPersonalInfo-legalPersonIdCardPhoto" enctype="multipart/form-data">
        <input id="merchantPersonalInfo-legalPersonIdCardPhoto-file" name="file" type="file"/>
    </form>

    <form action="${web_domain}/upload/image" method="post" id="upload-merchantPersonalInfo-legalPersonIdCardPhotoBack" enctype="multipart/form-data">
        <input id="merchantPersonalInfo-legalPersonIdCardPhotoBack-file" name="file" type="file"/>
    </form>

    <form action="${web_domain}/upload/image" method="post" id="upload-shopBanner" enctype="multipart/form-data">
        <input id="shopBanner-file" name="file" type="file"/>
    </form>


    <form action="${web_domain}/upload/avatar" method="post" id="upload-avatar" enctype="multipart/form-data">
        <input id="avatar-file" name="file" type="file"/>
    </form>

</div>

<script type="text/javascript" src="${web_domain}/resources/plugins/region2.0.js"></script>
<script>
    $(function () {

        //切换主体类型
        var id = $("input[name='mainType']:checked").val();
        if (id == 1) {
            $("#merchantEnterpriseInfo").show();
            $("#merchantIndividualInfo").hide();
            $("#merchantPersonalInfo").hide();
        }

        if (id == 2) {
            $("#merchantEnterpriseInfo").hide();
            $("#merchantIndividualInfo").show();
            $("#merchantPersonalInfo").hide();
        }

        if (id == 3) {
            $("#merchantEnterpriseInfo").hide();
            $("#merchantIndividualInfo").hide();
            $("#merchantPersonalInfo").show();
        }

        //企业主体信息的省市区级联选择下拉框
        var merchantEnterpriseInfonames = ["merchantEnterpriseInfo-province", "merchantEnterpriseInfo-city", "merchantEnterpriseInfo-area"];
        var merchantEnterpriseInfovalues = ["${merchant.merchantEnterpriseInfo.province}", "${merchant.merchantEnterpriseInfo.city}", "${merchant.merchantEnterpriseInfo.area}"];
        region($, merchantEnterpriseInfonames, merchantEnterpriseInfovalues);

        //个体户主体信息的省市区级联选择下拉框
        var merchantIndividualInfonames = ["merchantIndividualInfo-province", "merchantIndividualInfo-city", "merchantIndividualInfo-area"];
        var merchantIndividualInfovalues = ["${merchant.merchantIndividualInfo.province}", "${merchant.merchantIndividualInfo.city}", "${merchant.merchantIndividualInfo.area}"];
        region($, merchantIndividualInfonames, merchantIndividualInfovalues);

        //个人主体信息的省市区级联选择下拉框
        var merchantPersonalInfonames = ["merchantPersonalInfo-province", "merchantPersonalInfo-city", "merchantPersonalInfo-area"];
        var merchantPersonalInfovalues = ["${merchant.merchantPersonalInfo.province}", "${merchant.merchantPersonalInfo.city}", "${merchant.merchantPersonalInfo.area}"];
        region($, merchantPersonalInfonames, merchantPersonalInfovalues);

        //银行开户所属省市
        var merchantBanknames = ["bankProvince", "bankCity"];
        var merchantBankvalues = ["${merchant.bankProvince}", "${merchant.bankCity}"];
        region($, merchantBanknames, merchantBankvalues);


        //头像上传
        $("#choose-avatar").click(function () {
            $("#avatar-file").click();
        });
        $("#avatar-file").change(function () {
            $("#upload-avatar").ajaxSubmit({
                type: "post",
                dataType: "JSON",
                success: function (result) {
                    if (result.status) {
                        $("#avatar").attr("value", result.path);
                        $("#feijinImage-avatar").html("<img src='${store_domain}/avatar/" + result.path + "' style='width:120px;height:120px;margin-top:10px;' />'");
                    }
                },
                error: function (result) {
                    console.log(result.responseText);
                }
            });
        });

        //企业法人身份证上传
        $("#choose-shopBanner").click(function () {
            $("#shopBanner-file").click();
        });
        $("#shopBanner-file").change(function () {
            $("#upload-shopBanner").ajaxSubmit({
                type: "post",
                dataType: "JSON",
                success: function (result) {
                    if (result.status) {
                        $("#shopBanner").attr("value", result.path);
                        $("#feijinImage-shopBanner").html("<img src='${store_domain}/uploads/" + result.path + "' style='width:120px;height:120px;margin-top:10px;' />'");
                    }
                },
                error: function (result) {
                    console.log(result.responseText);
                }
            });
        });

        //企业法人身份证上传
        $("#choose-merchantEnterpriseInfo-legalPersonIdCardPhoto").click(function () {
            $("#merchantEnterpriseInfo-legalPersonIdCardPhoto-file").click();
        });
        $("#merchantEnterpriseInfo-legalPersonIdCardPhoto-file").change(function () {
            $("#upload-merchantEnterpriseInfo-legalPersonIdCardPhoto").ajaxSubmit({
                type: "post",
                dataType: "JSON",
                success: function (result) {
                    if (result.status) {
                        $("#merchantEnterpriseInfo-legalPersonIdCardPhoto").attr("value", result.path);
                        $("#feijinImage-merchantEnterpriseInfo-legalPersonIdCardPhoto").html("<img src='${store_domain}/uploads/" + result.path + "' style='width:120px;height:120px;margin-top:10px;' />'");
                    }
                },
                error: function (result) {
                    console.log(result.responseText);
                }
            });
        });

        //企业营业执照上传
        $("#choose-merchantEnterpriseInfo-businessLicensePhoto").click(function () {
            $("#merchantEnterpriseInfo-businessLicensePhoto-file").click();
        });
        $("#merchantEnterpriseInfo-businessLicensePhoto-file").change(function () {
            $("#upload-merchantEnterpriseInfo-businessLicensePhoto").ajaxSubmit({
                type: "post",
                dataType: "JSON",
                success: function (result) {
                    if (result.status) {
                        $("#merchantEnterpriseInfo-businessLicensePhoto").attr("value", result.path);
                        $("#feijinImage-merchantEnterpriseInfo-businessLicensePhoto").html("<img src='${store_domain}/uploads/" + result.path + "' style='width:120px;height:120px;margin-top:10px;' />'");
                    }
                },
                error: function (result) {
                    console.log(result.responseText);
                }
            });
        });

        //企业法人身份证反面上传
        $("#choose-merchantEnterpriseInfo-legalPersonIdCardPhotoBack").click(function () {
            $("#merchantEnterpriseInfo-legalPersonIdCardPhotoBack-file").click();
        });
        $("#merchantEnterpriseInfo-legalPersonIdCardPhotoBack-file").change(function () {
            $("#upload-merchantEnterpriseInfo-legalPersonIdCardPhotoBack").ajaxSubmit({
                type: "post",
                dataType: "JSON",
                success: function (result) {
                    if (result.status) {
                        $("#merchantEnterpriseInfo-legalPersonIdCardPhotoBack").attr("value", result.path);
                        $("#feijinImage-merchantEnterpriseInfo-legalPersonIdCardPhotoBack").html("<img src='${store_domain}/uploads/" + result.path + "' style='width:120px;height:120px;margin-top:10px;' />'");
                    }
                },
                error: function (result) {
                    console.log(result.responseText);
                }
            });
        });

        //个体户身份证正面上传
        $("#choose-merchantIndividualInfo-idCardPhoto").click(function () {
            $("#merchantIndividualInfo-idCardPhoto-file").click();
        });
        $("#merchantIndividualInfo-idCardPhoto-file").change(function () {
            $("#upload-merchantIndividualInfo-idCardPhoto").ajaxSubmit({
                type: "post",
                dataType: "JSON",
                success: function (result) {
                    if (result.status) {
                        $("#merchantIndividualInfo-idCardPhoto").attr("value", result.path);
                        $("#feijinImage-merchantIndividualInfo-idCardPhoto").html("<img src='${store_domain}/uploads/" + result.path + "' style='width:120px;height:120px;margin-top:10px;' />'");
                    }
                },
                error: function (result) {
                    console.log(result.responseText);
                }
            });
        });

        //个体户营业执照上传
        $("#choose-merchantIndividualInfo-businessLicensePhoto").click(function () {
            $("#merchantIndividualInfo-businessLicensePhoto-file").click();
        });
        $("#merchantIndividualInfo-businessLicensePhoto-file").change(function () {
            $("#upload-merchantIndividualInfo-businessLicensePhoto").ajaxSubmit({
                type: "post",
                dataType: "JSON",
                success: function (result) {
                    if (result.status) {
                        $("#merchantIndividualInfo-businessLicensePhoto").attr("value", result.path);
                        $("#feijinImage-merchantIndividualInfo-businessLicensePhoto").html("<img src='${store_domain}/uploads/" + result.path + "' style='width:120px;height:120px;margin-top:10px;' />'");
                    }
                },
                error: function (result) {
                    console.log(result.responseText);
                }
            });
        });

        //个体户身份证反面上传
        $("#choose-merchantIndividualInfo-idCardPhotoBack").click(function () {
            $("#merchantIndividualInfo-idCardPhotoBack-file").click();
        });
        $("#merchantIndividualInfo-idCardPhotoBack-file").change(function () {
            $("#upload-merchantIndividualInfo-idCardPhotoBack").ajaxSubmit({
                type: "post",
                dataType: "JSON",
                success: function (result) {
                    if (result.status) {
                        $("#merchantIndividualInfo-idCardPhotoBack").attr("value", result.path);
                        $("#feijinImage-merchantIndividualInfo-idCardPhotoBack").html("<img src='${store_domain}/uploads/" + result.path + "' style='width:120px;height:120px;margin-top:10px;' />'");
                    }
                },
                error: function (result) {
                    console.log(result.responseText);
                }
            });
        });


        //个人身份证上传
        $("#choose-merchantPersonalInfo-legalPersonIdCardPhoto").click(function () {
            $("#merchantPersonalInfo-legalPersonIdCardPhoto-file").click();
        });
        $("#merchantPersonalInfo-legalPersonIdCardPhoto-file").change(function () {
            $("#upload-merchantPersonalInfo-legalPersonIdCardPhoto").ajaxSubmit({
                type: "post",
                dataType: "JSON",
                success: function (result) {
                    if (result.status) {
                        $("#merchantPersonalInfo-legalPersonIdCardPhoto").attr("value", result.path);
                        $("#feijinImage-merchantPersonalInfo-legalPersonIdCardPhoto").html("<img src='${store_domain}/uploads/" + result.path + "' style='width:120px;height:120px;margin-top:10px;' />'");
                    }
                },
                error: function (result) {
                    console.log(result.responseText);
                }
            });
        });

        //个人身份证反面上传
        $("#choose-merchantPersonalInfo-legalPersonIdCardPhotoBack").click(function () {
            $("#merchantPersonalInfo-legalPersonIdCardPhotoBack-file").click();
        });
        $("#merchantPersonalInfo-legalPersonIdCardPhotoBack-file").change(function () {
            $("#upload-merchantPersonalInfo-legalPersonIdCardPhotoBack").ajaxSubmit({
                type: "post",
                dataType: "JSON",
                success: function (result) {
                    if (result.status) {
                        $("#merchantPersonalInfo-legalPersonIdCardPhotoBack").attr("value", result.path);
                        $("#feijinImage-merchantPersonalInfo-legalPersonIdCardPhotoBack").html("<img src='${store_domain}/uploads/" + result.path + "' style='width:120px;height:120px;margin-top:10px;' />'");
                    }
                },
                error: function (result) {
                    console.log(result.responseText);
                }
            });
        });


        //选择主体类型（企业、个体户、个人）
        layui.use(['form', 'laydate'], function () {

            var form = layui.form;
            var laydate = layui.laydate;

            form.on('radio(mainType)', function (data) {
                var id = data.value;

                if (id == 1) {
                    $("#merchantEnterpriseInfo").show();
                    $("#merchantIndividualInfo").hide();
                    $("#merchantPersonalInfo").hide();
                }

                if (id == 2) {
                    $("#merchantEnterpriseInfo").hide();
                    $("#merchantIndividualInfo").show();
                    $("#merchantPersonalInfo").hide();
                }

                if (id == 3) {
                    $("#merchantEnterpriseInfo").hide();
                    $("#merchantIndividualInfo").hide();
                    $("#merchantPersonalInfo").show();
                }
            });

            form.verify({
                bankcard: [/^\d*$/, '<fmt:message key='yhkznbhsz' />']
            });

            form.on('submit(submit)', function (data) {

                var mainType = $(":radio[name='mainType']:checked").val();

                if (!mainType) {
                    layui.use('layer', function () {
                        layer.msg("<fmt:message key='qxzsjztlx' />");
                    });

                    return false;
                }

                $("#serviceForm").ajaxSubmit({
                    success: function (result) {
                        if (result.status) {
                            layer.msg("<fmt:message key='bccg' />");
                        } else {
                            layer.msg(result.message);
                        }
                    }
                });
            });


        });

    });
</script>
</body>
</fmt:bundle>
</html>